
<style type="text/css">#rightbar{display: none;}.col-lg-8 {width: 100%;}</style>
<?php 
echo $html->css('/deals/css/deals.css');
?>
<div id="deals_index">
	<?php
	unset($paginator->Html);
	$paginator->Html = $appHtml;
	$paginator->options(array('url'=>$this->getPagingUrl()));	
	
	echo $this->element('deals_index_categories', array('discountTypes'=>$discountTypes,'pageTitle'=>$pageTitle,'categoryId'=>$categoryId, 'categories' => $categories));
	?>
	<div class="clear"></div>
	<h2><?php echo $pageTitle; ?></h2>
	<div class="clear"></div>
	<!--
	<div class="city_filter fr">
	<?php
	$pagingUrl = $this->getPagingUrl();
	$presentUrl = $appHtml->url(am($pagingUrl,array_diff_key($this->params['named'],array("page"=>null))));
	//echo $form->input('city_filter',array('label'=>__('Filter By City'),'type'=>'select','options'=>$filterUrls,'onchange'=>"$('#sortLink').attr('href',$(this).val()).trigger('click')",'value'=>$presentUrl));
	?>
	<a style = 'display: none;' id="sortLink" class="paging_ajaxify"></a>
	</div>
	<br /> <br /> <br />
	-->
	<?php 
	if(!empty($deals))
	{
		?>
	<div>
		<?php echo $this->element('deals', array('deals' => $deals,'discountTypes'=>$discountTypes,'pageTitle'=>$pageTitle,'categoryId'=>$categoryId));?>
	</div>
	<div class='paginate'>
		<?php echo $paginator->prev(__('Prev'));?>
		<?php echo $paginator->numbers(array('separator'=>' '));?>
		<?php echo $paginator->next(__('Next'));?>
	</div>

	<div class="clear"></div>
	<?php 
	}
	else
	{
		echo "<h4 class='no_results'>".__('No deals found!')."</h4>";
	}
	?>
		
</div>
<?php $javascript->link('/cms/js/jquery.ajaxify.js',false)?>
<script type="text/javascript">
$(document).ready(function()
{
	makeAjaxified($('#deals_index').find('#sortLink,.paginate a'),'deals_index');
});
</script>
